<template>
  <common_print_dialog ref="common_print_dialog" businessType="PRE_BIN" v-bind="$attrs" v-on="$listeners"
    :generateUrl="generateUrl" printUrl="/print-api/template/PrintRpc/print.json" :printHandler="(data, list) => {
      data.metaDataList = list.map(it => ({
        metadata: { binNo: it, printType: data.type, },
        printNum: data.printNumSum,
      }))
      return data
    }" previewUrl="/print-api/template/PrintRpc/previewPrintBase.json" :previewHandler="(data, code) => {
  data.metadata = JSON.stringify({ binNo: code, printType: data.type, })
  return data
}" />
</template>

<script>
import common_print_dialog from '@/component/print/common_print_dialog.vue'
export default {
  components: { common_print_dialog },
  data() {
    return {
      generateUrl: "/wms-api/inbound/WmsInboundTransitReceivingRpc/generateBatchBoxNo.json"
    }
  },
  methods: {

    show({ list, code, generateUrl }) {
      if (generateUrl) {
        this.generateUrl = generateUrl
      }
      this.$refs.common_print_dialog.show([], { generateParams: { inboundOrderCode: code } }, {
      })
    },



  }
}
</script>
